package generater;

/**
 * Created by Administrator on 2017/11/7 0007.
 */
public class TableField {
    private String fieldName;
    private String dateType;
    private String comment;

    public String getDateType() {
        return dateType;
    }


    public String getJavaType(){
        if(dateType.contains("int")){
            return "Long";
        }
        if(dateType.contains("float")){
            return "Float";
        }
        if(dateType.contains("double")){
            return "Double";
        }
        if(dateType.contains("varchar")){
            return "String";
        }
        if(dateType.contains("datetime")){
            return "Date";
        }
        if(dateType.contains("bit")){
            return "boolean";
        }
        return "";
    }



    public void setDateType(String dateType) {
        this.dateType = dateType;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getFieldName() {

        return fieldName;
    }
    public String getFieldNameUpcase(){
        if(fieldName!=null){
            StringBuilder sb=new StringBuilder(fieldName);
            Character ch=sb.charAt(0);
            sb.replace(0,1,ch.toString().toUpperCase());
            return sb.toString();
        }
        return fieldName;
    }


    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
}
